﻿namespace MsForgeReboot.Framework.Entities {
    #region Usings

    using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    #endregion

    /// <summary>
    ///   The feed.
    /// </summary>
    public class Feed {
        #region Public Properties

        /// <summary>
        ///   Gets or sets the id.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        ///   Gets or sets the url.
        /// </summary>
        [DataType(DataType.Url)]
        [MaxLength(500)]
        [Required]
        public string URL { get; set; }

        /// <summary>
        ///   Gets the uri.
        /// </summary>
        [NotMapped]
        public Uri Uri {
            get {
                return new Uri(this.URL);
            }
        }

        #endregion
    }
}